package com.jz.community.sharesdk.share;

import android.app.Activity;
import android.content.Context;

import com.jz.community.basecomm.utils.WpToast;
import com.umeng.socialize.UMShareListener;
import com.umeng.socialize.bean.SHARE_MEDIA;

import java.lang.ref.WeakReference;

/**
 * Created by Tony.Fan on 2018/4/2 17:25
 * 分享回调
 */
public class ShareListener implements UMShareListener {

    private Context mActivity;

    public ShareListener(Activity activity) {
        mActivity = activity;
    }

    /**
     * @param platform 平台类型
     * @descrption 分享开始的回调
     */
    @Override
    public void onStart(SHARE_MEDIA platform) {
    }

    /**
     * @param platform 平台类型
     * @descrption 分享成功的回调
     */
    @Override
    public void onResult(SHARE_MEDIA platform) {
        WpToast.l(mActivity, "分享成功");
    }

    /**
     * @param platform 平台类型
     * @param t        错误原因
     * @descrption 分享失败的回调
     */
    @Override
    public void onError(SHARE_MEDIA platform, Throwable t) {
    }

    /**
     * @param platform 平台类型
     * @descrption 分享取消的回调
     */
    @Override
    public void onCancel(SHARE_MEDIA platform) {
        WpToast.l(mActivity, "分享取消");
    }
}
